using UnityEngine;
using System.Collections;

public class SpecialCube : MonoBehaviour {
		
	void Start()
	{
		StartCoroutine("SwitchColor");
	}
	
	IEnumerator SwitchColor()
	{
		yield return new WaitForSeconds(0.1f);
		Color color = new Color(Random.Range(0.0f,1.0f),Random.Range(0.0f,1.0f),Random.Range(0.0f,1.0f),renderer.material.color.a);
		renderer.material.color = color;
		StartCoroutine("SwitchColor");
	}
	void OnResume()
	{
		StartCoroutine("SwitchColor");
	}
}
